﻿using GalaSoft.MvvmLight.Messaging;
using MvvmLightDemo.Views;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using static System.Net.Mime.MediaTypeNames;

namespace MvvmLightDemo
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            Messenger.Default.Register<string>(this, "open", MessageExecute);
        }

        private void MessageExecute(string obj)
        {
            new SubWindow() { Owner = this}.Show();
        }
    }
}